package com.kolalo.comm;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexHelper {
	public static List<String> regex(String content, String pattern) {
		List<String> list = new ArrayList<String>();
		try {
			Matcher matcher = Pattern.compile(pattern).matcher(content);
			while (matcher.find()) {
				list.add(matcher.group());
			}
		} catch (Exception e) {
		}
		return list;
	}
	
	public static boolean isMatch(String content, String pattern) {
		return Pattern.compile(pattern).matcher(content).find();
	}
}
